<!-- 收获地址详情弹窗 -->
<template>
            <a-form
                    ref="form3"
                    class="ele-form-detail"
                    :model="shippingAddressModalApp.shippingAddress"
                    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
                    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
                <a-descriptions :title="shippingAddressModalApp.title" bordered>
                                    <a-descriptions-item label="标识">
                        {{ shippingAddressModalApp.shippingAddress.Eid }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人">
                        {{ shippingAddressModalApp.shippingAddress.creatorName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="名称">
                        {{ shippingAddressModalApp.shippingAddress.name }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="用户">
                        {{ shippingAddressModalApp.shippingAddress.userId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="电话号码">
                        {{ shippingAddressModalApp.shippingAddress.phone }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="所在地区">
                        {{ shippingAddressModalApp.shippingAddress.area }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="详细地址">
                        {{ shippingAddressModalApp.shippingAddress.detailedAddress }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="状态">
                        {{ shippingAddressModalApp.shippingAddress.status }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人ID">
                        {{ shippingAddressModalApp.shippingAddress.creatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="备注">
                        {{ shippingAddressModalApp.shippingAddress.remark }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建时间">
                        {{ shippingAddressModalApp.shippingAddress.createDatetime }}
                    </a-descriptions-item>
                                </a-descriptions>
            </a-form>
</template>

<script>
    import {defineComponent, reactive, onMounted, inject} from "vue";
    import {useRoute} from "vue-router"
    import {ShippingAddressService} from "@/views/mall/User/shippingAddress/shippingAddressService";

    export default defineComponent({
        setup() {
            const route = useRoute();
            let routeId = route.params.id;
            let shippingAddressListApp = inject('shippingAddressListApp', reactive({}));
            const shippingAddressModalApp = reactive({id: null, shippingAddress: {}, display: false});

            onMounted(() => {
                    shippingAddressModalApp.shippingAddress = {};
                if (routeId) {
                        shippingAddressModalApp.id = routeId;
                } else if (shippingAddressListApp.viewModalShowing) {
                        shippingAddressModalApp.id = shippingAddressListApp.currentId;
                        shippingAddressModalApp.display = true;
                }
                if (shippingAddressModalApp.id) {
                    getInfo(shippingAddressModalApp.id);
                }
            })

            const getInfo = (id) => {
                    ShippingAddressService.findShippingAddress(id).then((res) => {
                            shippingAddressModalApp.shippingAddress = res.data;
                            shippingAddressModalApp.title = "查看 " + shippingAddressModalApp.shippingAddress.name;
                })
            }

            return {
                    shippingAddressModalApp,
                routeId,
                getInfo,
            }
        }
    })
</script>

<style scoped>
</style>

